package net.csdn.business.common.domain.open;

import com.alibaba.fastjson2.JSONObject;
import com.fasterxml.jackson.databind.PropertyNamingStrategies;
import com.fasterxml.jackson.databind.annotation.JsonNaming;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * @author likun
 * @date 2023/5/24 17:36
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@JsonNaming(value = PropertyNamingStrategies.SnakeCaseStrategy.class)
public class AppInstallationsTokenRequestDTO implements Serializable {
    private Long installationId;

    private String repositories;

    private String repositoryIds;

    /**
     * {"issues":"write","contents":"read"}
     * {"pull_requests":"write,read"}
     */
    private JSONObject permissions;

    public AppInstallationsTokenRequestDTO(Long installationId, String repositories) {
        this.installationId = installationId;
        this.repositories = repositories;
    }
}